package com.geline.easytrans.enums;

import com.geline.easytrans.annotation.DictType;
import com.geline.easytrans.dict.IDict;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 是否定义(0否，1是)
 * @author: mengxin
 * @date: 2022/9/1 15:48
 */
@DictType(value = "sys_true_false", label = "是否定义")
@AllArgsConstructor
@Getter
public enum SysTrueFalseEnum implements IDict {
    TRUE(0, "否"),
    FALSE(1, "是");

    private Integer code;
    private String desc;

    @Override
    public String getLabel() {
        return desc;
    }

    @Override
    public Object getValue() {
        return code;
    }

    @Override
    public Boolean getDefault() {
        return code==0;
    }
}
